package com.consumer;

import com.api.service.FeignClientService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.feign.EnableFeignClients;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by PengJie.Dai on 2018/6/20.
 */
@SpringBootApplication
@EnableFeignClients(basePackageClasses=FeignClientService.class)
@RestController
@RequestMapping("/*")
public class FeignConsumerEntry {

    @Autowired
    private FeignClientService service;

    public static void main(String[] args) {
        SpringApplication.run(FeignConsumerEntry.class, args);
    }

    @RequestMapping("/service")
    public String service() {
        return service.service();
    }
}
